package com.umeng.fb.util;

import android.content.Context;
import org.json.JSONException;
import org.json.JSONObject;

public class b
{
  public static JSONObject a(Context paramContext, String paramString, int paramInt1, int paramInt2, JSONObject paramJSONObject1, JSONObject paramJSONObject2)
  {
    monitorenter;
    while (true)
    {
      JSONObject localJSONObject1;
      JSONObject localJSONObject2;
      try
      {
        localJSONObject1 = com.umeng.fb.g.c(paramContext);
      }
      finally
      {
        try
        {
          localJSONObject1.put("user_id", localJSONObject1.getString("idmd5"));
          localJSONObject1.put("thread", paramString);
          localJSONObject1.put("content", "Not supported on client yet");
          localJSONObject1.put("datetime", com.umeng.common.b.g.a());
          localJSONObject1.put("feedback_id", a.a("FB", localJSONObject1.getString("appkey"), localJSONObject1.getString("user_id")));
          localJSONObject1.put("type", "new_feedback");
          localJSONObject2 = new JSONObject();
          localJSONObject2.put("age_group", paramInt1);
          switch (paramInt2)
          {
          default:
            localJSONObject2.put("contact", paramJSONObject1);
            localJSONObject2.put("remark", paramJSONObject2);
            localJSONObject1.put("userinfo", localJSONObject2);
            monitorexit;
            return localJSONObject1;
          case 1:
            label162: localJSONObject2.put("gender", "male");
          case 2:
          }
        }
        catch (JSONException localJSONException)
        {
          localJSONException.printStackTrace();
          break label162:
          localObject = finally;
          monitorexit;
          throw localObject;
        }
      }
      localJSONObject2.put("gender", "female");
    }
  }

  public static JSONObject a(Context paramContext, String paramString1, String paramString2)
  {
    String str1;
    String str2;
    JSONObject localJSONObject;
    monitorenter;
    try
    {
      str1 = com.umeng.common.b.p(paramContext);
      label94: localJSONObject = new JSONObject();
    }
    finally
    {
      try
      {
        localJSONObject.put("type", "user_reply");
        localJSONObject.put("appkey", str1);
        localJSONObject.put("content", paramString1);
        localJSONObject.put("user_id", str2);
        localJSONObject.put("datetime", com.umeng.common.b.g.a());
        localJSONObject.put("feedback_id", paramString2);
        localJSONObject.put("reply_id", a.a());
        monitorexit;
        return localJSONObject;
      }
      catch (JSONException localJSONException)
      {
        localJSONException.printStackTrace();
        break label94:
        localObject = finally;
        monitorexit;
        throw localObject;
      }
    }
  }

  public static boolean a(JSONObject paramJSONObject)
  {
    if (paramJSONObject == null)
      return false;
    try
    {
      if (paramJSONObject.has("state"));
      boolean bool = "ok".equals(paramJSONObject.getString("state"));
      if (bool);
      return true;
    }
    catch (Exception localException)
    {
      localException.printStackTrace();
    }
    return false;
  }

  public static boolean a(JSONObject paramJSONObject, String paramString1, String paramString2)
  {
    int i;
    monitorenter;
    try
    {
      paramJSONObject.put(paramString1, paramString2);
      i = 1;
      return i;
    }
    catch (JSONException localJSONException)
    {
      localJSONException.printStackTrace();
    }
    finally
    {
      monitorexit;
    }
  }

  public static boolean b(JSONObject paramJSONObject)
  {
    monitorenter;
    while (true)
      try
      {
        if (paramJSONObject.has("state"))
        {
          paramJSONObject.remove("state");
          i = 1;
          return i;
        }
        int i = 0;
      }
      finally
      {
        monitorexit;
      }
  }

  public static boolean c(JSONObject paramJSONObject)
  {
    monitorenter;
    try
    {
      boolean bool = a(paramJSONObject, "state", "fail");
      monitorexit;
      return bool;
    }
    finally
    {
      localObject = finally;
      monitorexit;
      throw localObject;
    }
  }

  public static boolean d(JSONObject paramJSONObject)
  {
    monitorenter;
    try
    {
      boolean bool = a(paramJSONObject, "state", "sending");
      monitorexit;
      return bool;
    }
    finally
    {
      localObject = finally;
      monitorexit;
      throw localObject;
    }
  }

  public static boolean e(JSONObject paramJSONObject)
  {
    monitorenter;
    try
    {
      boolean bool = a(paramJSONObject, "state", "ok");
      monitorexit;
      return bool;
    }
    finally
    {
      localObject = finally;
      monitorexit;
      throw localObject;
    }
  }
}

/* Location:           H:\360云盘\lewa_explorer_3.0\bin\FileApp_orig_dex2jar.jar
 * Qualified Name:     com.umeng.fb.util.b
 * JD-Core Version:    0.5.2
 */